<template>
  <div class="left-container">
    <h3>{{msg}}</h3>
    <button @click="send">发送数据</button>
  </div>
</template>

<script>
import bus from '@/js/eventBus.js'
export default {
  data(){
    return{
      msg:"left组件"
    }
  },
  methods:{
    send(){
      bus.$emit('share',this.msg)
    }
  }
}
</script>

<style lang="less" scoped>
.left-container {
  padding: 0 20px 20px;
  background-color: rgb(0, 225, 255);
  min-height: 250px;
  flex: 1;
}
h3 {
  color: red;
}
</style>